<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String roomName = (String) request.getAttribute("roomName");
	String roomId = (String) request.getAttribute("roomId");
	String time = (String) request.getAttribute("time");
	String year = (String) request.getAttribute("year");
	String month = (String) request.getAttribute("month");
	String shangxia = (String) request.getAttribute("shangxia");
	String shijian = "09:00";
	if("下午".equals(shangxia)){
		shijian = "14:00";
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<base href="<%=basePath%>" />
	<title>天津市粮油集团有限公司</title>
	<style type="text/css">
		.daohang {
		    background-image: url(<%=basePath%>images/ju.gif) !important;
		}
		td {
			font:12px/170% "宋体", "新宋体", "黑体"; color:#000
		}
		th {
			font:12px/170% "宋体", "新宋体", "黑体"; color:#000
		}
		.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 1200px;
			height: 800px;
			background-color: gray;
			z-index:1001;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=80);

		}

		/* 添加任务div样式 */
		.ceshi5 {
			    display: none;
				position: absolute;
				top: 25%;
				left: 30%;
				width: 253px;
				height: 235px;
				border: 1px solid #11557B;
				border-bottom: block;
				background-color: #E2F7FF;
				z-index: 1003;
				overflow: auto;
		}
  </style>
	<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
	<!-- 多系统树 开始 -->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
	<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxfileupload.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/common/fileUpload/ajaxFileZx.js"></script>
	<!-- 结束 -->
	<script type='text/javascript' src='<%=basePath%>dwr/interface/MeetingRoomEmployBo.js'></script>
	<script type='text/javascript' src="<%=basePath%>dwr/engine.js"></script>
	<script type='text/javascript' src="<%=basePath%>dwr/util.js"></script>
	
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
		function checkAllTextValid(form)  
		{  
		    //记录不含引号的文本框数量  
			var resultTag = 0;  
			//记录所有text文本框数量  
			var flag = 0;  
			for(var i = 0; i < form.elements.length; i ++)  
			{  
			 if(form.elements[i].type=="text")  
			 {  
			     flag = flag + 1;  
			  //此处填写所要过滤的特殊符号  
			  //注意：修改####处的字符，其它部分不许修改.  
			  //if(/^[^####]*$/.test(form.elements[i].value))  
			  if(/^[^\|"'<>]*$/.test(form.elements[i].value)) resultTag = resultTag+1;  
			  else form.elements[i].select();  
			 }  
			}
			//如果含引号的文本框等于全部文本框的值，则校验通过  
			if(resultTag == flag) return true;  
			else 
			{  
			 Ext.MessageBox.alert('提示框',"<nobr>文本框中不能含有<br/> 1 单引号: ' <br/> 2 双引号: \" <br/> 3 竖  杠: | <br/> 4 尖角号: < > <br/><br/>请检查输入！</nobr>");  
			 return false;  
			}  
		} 
		
		function submitpages(value){
			if(value==-1){
			    Ext.MessageBox.alert('提示框','<nobr>请重新选择会议室</nobr>');
				return false;
			}
		}
		// 判断不能为空
		function submitform1(){
		if(document.form1.meetingName.value == null || document.form1.meetingName.value == ''){
			Ext.MessageBox.alert('提示框','<nobr>请填入会议名称</nobr>');
		}
		else if(document.form1.meetingName.value.length>20){
		    Ext.MessageBox.alert('提示框','<nobr>会议名称不能超过20个汉字</nobr>');
		}
		else if(document.form1.starttime.value == ''){
		    Ext.MessageBox.alert('提示框','<nobr>请选择开始时间</nobr>');
		}
		else if(document.form1.meetingPeopleId.value == ''  ){
		    Ext.MessageBox.alert('提示框','<nobr>请填入领导及部门</nobr>');
		}
		else{
			if(checkAllTextValid(document.form1))document.form1.submit();
		}
	}
	
	function bianhua(){
		var start = document.form1.starttime.value;
		if(start!=null){
			if(start.split(':')[0].substring(0,1)=='1' && parseInt(start.split(':')[0].substring(1,2))>2){
				document.form1.remarks.value = '下午';
			}else{
				document.form1.remarks.value = '上午';
			}
		}
	}
	
	function back()
	{
		history.back(-1);
	}
	window.onload = function(){
		document.getElementById("right").style.height = document.body.clientHeight;
		document.getElementById("tableid").style.height = document.body.clientHeight-60;
		var tb = new Ext.Toolbar(
			{
				height:25
			}
		);
		tb.render('menu');
		tb.add(
	    {
	            text:'确定',
	            iconCls: 'daohang',
	        	handler: function(){
	        		submitform1();
				}
	    },
	    {
	            text:'返回',
	            iconCls: 'daohang',
	        	handler: function(){
	        		back();
				}
	    }
	    );
		tb.addFill();
	    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;">会议安排</a>&nbsp;&nbsp;&nbsp;');
	    tb.render('menu');
	}
    </script>
	</head>
	<body>
	<form action="<%=basePath%>tjsinfo/tjsoa/meetingroom/newArrangements.do" method="post" name="form1">
       	<input type="hidden" name="node2" id="node2"/>
       	<input id="basePath" value="<%=basePath%>" type="hidden"/>
       	<input type="hidden" name="roomId" id="roomId" value="<%=roomId %>"/>
		<input type="hidden" name="time" value="<%=time%>" />
		<input type="hidden" name="year" value="<%=year%>" />
		<input type="hidden" name="month" value="<%=month%>" />
		<div id="right">
		<div id="menu" style="padding-top:4px;"></div>
     	<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tableid">
          <tr>
            <td valign="top" height="100%">
               <div class="contabwd">
               		<table width="100%" height="400"border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="90%">
                            	<table border="0" cellspacing="0" cellpadding="0" align="left" style="margin-top:10px; margin-left:20px">
                                  <tr>
                                    <td>
                                            <table border="0" align="left" cellpadding="0" cellspacing="0" class="ttaabb">
                                              <tr>
                                              <td width="25%" align="right"><img src="images/dfdf_03.gif" />&nbsp;开会日期:</td>
                                              <td><%=time %></td>
                                              </tr>
                                              <tr>
                                              <td width="25%" align="right"><img src="images/dfdf_03.gif" />&nbsp;所在会议室:</td>
                                              <td><%=roomName %></td>
                                              </tr>
                                              <tr>
                                                <td width="25%" align="right"><img src="images/dfdf_03.gif" />&nbsp;会议名称:</td>
                                                <td width="65%"><input name="meetingName" type="text" size="41" style="border:1px #C0C0C0 solid;background:#F4F4F4; height:19px" value="部门专业会"/></td>
                                                <td width="10%">&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;开始时间:</td>
                                                <td>
                                                <input type="text" id="starttime" name="starttime" onfocus="WdatePicker({dateFmt:'HH:mm'})" class="Wdate" value="<%=shijian %>" onchange="bianhua();"/>
                                                </td>
                                                <td>&nbsp;</td>
                                              </tr>
												<tr>
													<td align="right">
														<img src="images/dfdf_03.gif" />
														&nbsp;持续时间:
													</td>
													<td>
														<select id="endtime" name="endtime">
															<option value="1">1</option>
															<option value="2" selected="selected">2</option>
															<option value="3">3</option>
															<option value="4">4</option>
															<option value="5">5</option>
															<option value="6">6</option>
															<option value="7">7</option>
															<option value="8">8</option>
															<option value="9">9</option>
															<option value="10">10</option>
														</select>小时
													</td>
													<td>
														&nbsp;
													</td>
												</tr>
											<tr>
												<td align="right">
													<img src="images/dfdf_03.gif" />
													&nbsp;会议时间段:
												</td>
												<td>
													<select id="remarks" name="remarks">
														<option value="上午" <%if(!"下午".equals(shangxia))out.print("selected"); %>>上午</option>
														<option value="下午" <%if("下午".equals(shangxia))out.print("selected"); %>>下午</option>
														<option value="全天">全天</option>
													</select>
												</td>
												<td>
													&nbsp;
												</td>
											</tr>
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;领导及部门:</td>
                                                <td><input name="meetingPeopleId" id="meetingPeopleId" type="text" size="95" style="border:1px #C0C0C0 solid;background:#F4F4F4; height:19px"/></td>
                                                <td>&nbsp;						
												</td>
                                              </tr>
                                              <tr>
                                                <td align="right"><img src="images/dfdf_03.gif" />&nbsp;内容及特殊需要:</td>
                                                <td><textarea name="content" cols="69" rows="10"></textarea></td>
                                                <td>&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <th colspan="3">&nbsp;</th>
                                              </tr>
                                            </table>
                                    </td>
                                  </tr>
                                </table>
                            </td>
                          </tr>
                     </table>
              </div>
            </td>
          </tr>
      </table>
		</div>
		</form>
		<div id="tree" class="ceshi5"></div>
	    <div id="fade" class="black_overlays" ></div>
	    <div id="ceshi5" class="ceshi5"><input type="button" value="确定人选" onclick="test3()" id="button1"/></div><div align="center"></div>
	</body>
</html>
